fix: install Claude Code AI plugin in user and project scopes#451
Draft
skoob13 wants to merge 2 commits into
Draft
fix: install Claude Code AI plugin in user and project scopes#451skoob13 wants to merge 2 commits into
skoob13 wants to merge 2 commits into
Conversation
The wizard previously ran `claude plugin install posthog`, which defaults to user scope only. Now also install with `--scope project` so the plugin is recorded in `.claude/settings.json` for collaborators on the repo, in addition to the existing per-user install. Overall success is reported if at least one scope succeeds, so a stricter project scope failure (e.g. write-protected `.claude/`) does not regress the existing user-scope behavior. Generated-By: PostHog Code Task-Id: 66273d08-6eb4-42cf-96b7-ddfe48159e2b
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
Adds a `PluginScope` parameter ('user' | 'project' | 'both') to the
plugin install path and a scope picker in `McpScreen` shown after
feature selection, when at least one selected client supports plugins
and `.git` exists in the working directory. User scope is the default
(matches the previous behavior); project scope writes the plugin to
`.claude/settings.json` so collaborators pick it up; "both" installs
to both places.
When no `.git` is present, the picker is skipped and the user-scope
default is used, since project scope would not be meaningful.
- plugin-client: new PluginScope type + DEFAULT_PLUGIN_SCOPE='user'
- claude-code: installPlugin(scope) runs `claude plugin install posthog
--scope <scope>` for each requested scope; 'both' aggregates results
(success if either succeeds, alreadyInstalled if both report so)
- codex: accepts the param but ignores it (no scope concept)
- mcp-installer: new optional scope arg forwarded to the orchestrator
and into analytics
- McpScreen: new PluginScopeSelect phase shown only when meaningful
- Tests updated for the new defaults and scope plumbing
Generated-By: PostHog Code
Task-Id: 66273d08-6eb4-42cf-96b7-ddfe48159e2b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claude plugin install posthog, which defaults to the user scope only (global to the developer, across all projects).--scope project, persisting the plugin to the repo's.claude/settings.jsonso collaborators get the AI plugin too when they pick up the project..claude/) does not regress the existing global-install path.alreadyInstalledis only true when both scopes report the plugin is already in place.Why
The wizard exists to set up PostHog for a project. The AI plugin is part of that setup, so it should land in both places:
~/.claude/settings.json) — the dev keeps the plugin everywhere they work..claude/settings.json, committed) — the rest of the team picks up the plugin via git without rerunning the wizard.See Claude Code's configuration scopes for the precedence and persistence model.
Test plan
claude-code.test.tscover: both scopes succeed, both report already-installed, one scope fails (overall success), both fail (overall failure), and no binary found.Created with PostHog Code